﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteJN.Master" AutoEventWireup="true" CodeBehind="showyjlist.aspx.cs" Inherits="jnagr.Web.info.showyjlist" %>
<%@ Register Src="~/Controls/checkright.ascx" TagPrefix="uc1" TagName="checkright" %>
<%@ Register Src="~/Controls/copyright.ascx" TagPrefix="uc1" TagName="copyright" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style>
        .tabnew {
            float: left;
            margin: 1px;
        }

        .fite {
            width: 550px;
            /*float: left;*/
            height: 30px;
        }

            .fite label {
                width: 80px;
                text-align: right;
                display: block;
                float: left;
            }

        .ncontent {
            width:1190px;            
            line-height: 25px;
            overflow: hidden;
            margin-top: 5px;
            float: left;
        }
        .newstime {
            width:100px;
            float:right;
        }
        .newscontent {
            font-size:18px;
            line-height:28px;
        }
        .newstime {
            width:160px;
        }
    </style>
    <script type="text/javascript">
        var type = "";
        var pSize = 10;
        var count = 100;
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
        $(function () {
            $(".toptitle").attr("class", "stoptitle");
            //var h = $(window).height() - 210;
            //$('#warningcontentDiv').height(h - 50);
            type = getUrlParam("type");
            if (type == "01")
                type = "灾情预警";
            else if (type == "02")
                type = "虫情预警";
            else if (type == "03")
                type = "墒情预警";
            else if (type == "04")
                type = "苗情预警";
            $("#mytitle").html(type);
            var tab=$("#mytab").tabs('getTab', 0);
            $('#mytab').tabs('update', {
                tab: tab,
                options: {
                    title:type
                }
            });
            type = encodeURI(encodeURI(type));
            $.ajax({
                type: "post",
                dataType: "json",
                url: "GetInfo.ashx?action=querymy&rows=" + pSize + "&page=1&alarmclass=" + type,
                success: function aa(data) {
                    count = data.total;
                    renderinfo(data);
                    $('#pp').pagination({
                        pageSize: pSize,
                        total: count,
                        onSelectPage: function (pageNumber, pageSize) {
                            $.ajax({
                                type: "post",
                                dataType: "json",
                                url: "GetInfo.ashx?action=querymy&rows=" + pageSize + "&page=" + pageNumber + "&alarmclass=" + type,
                                success: function aa(data) {
                                    renderinfo(data);
                                }
                            });
                        }
                    });
                }
            });

        });
        function renderinfo(getdata) {
            var html = template('tmpstations', getdata);
            $('#infos').html(html);
        }

    </script>
    <script id="tmpstations" type="text/html">
        {{each rows as value index}}
          <div class="newscontent">
          <a class="newstitle" href="show.aspx?id={{value.iid}}">{{value.title}}</a><div class="newstime" style="width:180px;">{{value.infotime}}</div>
          </div>
        {{/each}} 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="mainDiv">
        <uc1:checkright runat="server" ID="checkright" />
        <div id="menueDiv">
                <div id="menuem">
                    <div class="menueother">
                        <div id="mytitle" title="" class="menueparentDiv" etitle="JCYJ" >
                            通知公告
                        </div>
                    </div>
                </div>
            </div>
        <div>
            <div id="contentDivmy" style="height:auto;">
                <div id="myinfos" style="width:1000px;margin:0 auto;">
                    <div class="tabnew" style="width:1000px;margin:0 auto;">
                        <div id="mytab" class="easyui-tabs">
                            <div title="预警信息" style="padding: 5px;">
                                <div  id="warningcontentDiv" style="margin:5px;position: relative;height:auto;">
                                    <div id="infos" style="margin-bottom:10px;height:400px;"></div>
                                    <div id="pp" class="easyui-pagination" data-options="total:100,pageSize:10,pageList:[10]" style="position: absolute; background:#efefef;border:1px solid #ccc;width:980px;margin:0 auto;bottom:5px"></div> 
                                </div>
                            </div>
                        </div>
                    </div>
                <div style="clear: both;"></div>
            </div>
            </div>
            <uc1:copyright runat="server" ID="copyright" />
        </div>
    </div>
</asp:Content>

